#!/usr/bin/python
# -*- coding:utf-8 -*-

"""
This example demostrates a static box widget

example is from zetcode.com
"""



import wx

class Example(wx.Frame):
    
    def __init__(self, *args, **kwds):
        super(Example, self).__init__(*args, **kwds)
        
        self.InitUI()


    def InitUI(self):
        panel = wx.Panel(self)
        wx.StaticBox(panel, label='Personal Info', pos=(5, 5), size=(240, 170))
        wx.CheckBox(panel, label='Male', pos=(15, 30))
        wx.CheckBox(panel, label='Married', pos=(15, 55))
        wx.StaticText(panel, label='Age', pos=(15, 95))
        wx.SpinCtrl(panel, value='1', pos=(55, 90), size=(60, -1), min=1, max=120)
        btn = wx.Button(panel, label='Ok', pos=(90, 185), size=(60, -1))

        btn.Bind(wx.EVT_BUTTON, self.OnClose)

        self.SetSize((270, 250))
        self.SetTitle('Static box')
        self.Centre()
        self.Show(True)
        
    def OnClose(self, e):
        self.Close(True)


def main():
    ex = wx.App()
    Example(None)
    ex.MainLoop()

if __name__ == '__main__':
    main()
